﻿using System.ComponentModel;
using Microsoft.Win32;

namespace WindowsAPI
{
    public partial class RegistryComponent : Component
    {
        /* ------------------------------------------------------------------------------------------ */



        /* ------------------------------------------------------------------------------------------ */



        /* ------------------------------------------------------------------------------------------ */

        public RegistryKey ClassesRoot { get { return Registry.ClassesRoot; } }
        public RegistryKey CurrentConfig { get { return Registry.CurrentConfig; } }
        public RegistryKey CurrentUser { get { return Registry.CurrentUser; } }
        public RegistryKey DynData { get { return Registry.DynData; } }
        public RegistryKey LocalMachine { get { return Registry.LocalMachine; } }
        public RegistryKey PerformanceData { get { return Registry.PerformanceData; } }
        public RegistryKey Users { get { return Registry.Users; } }

        /* ------------------------------------------------------------------------------------------ */

        public RegistryComponent() { InitializeComponent(); }

        public RegistryComponent(IContainer container) { container.Add(this); InitializeComponent(); }

        /* ------------------------------------------------------------------------------------------ */

        public object GetValue(string key, string value, object defaultValue = null)
        {
            return Registry.GetValue(key, value, defaultValue);
        }

        public void SetValue(string key, string valueName, object value)
        {
            Registry.SetValue(key, valueName, value);
        }

        /* ------------------------------------------------------------------------------------------ */
    }
}
